import React, { Component } from 'react';
import { CSSTransition } from "react-transition-group";
const Routehoc = (Com) => {
  class newCom extends Component{
    render(){
      return <CSSTransition
      in={this.props.match!=null}
      timeout={1000}
      unmountOnExit
      classNames={{
        enter:'animate__animated',
        enterActive:'animate__fadeInRight',
        exit:'animate__animated',
        exitActive:'animate__fadeOutLeft'
      }}
      >
        <Com {...this.props}/>
      </CSSTransition>
    }
  }
  return newCom
}

export default Routehoc;
